<template>
<el-input v-model="data.phone" placeholder="手机号"></el-input>
<el-button type="primary" @click="submit">提交</el-button>

</template>




<script setup>
import { ref } from 'vue';
import axios from 'axios';
import{ useRouter } from 'vue-router';
const router = useRouter();


const data = ref({
    phone:"",
});

const submit = () => {
    axios.post("http://127.0.0.1:8000/rbac/login/",data.value)
    .then((res) => {

        localStorage.setItem("token",res.data.token);
        localStorage.setItem('retoken',res.data.retoken);
        localStorage.setItem('list',JSON.stringify(res.data.list));
        localStorage.setItem('page_list',JSON.stringify(res.data.page_list));
        router.push("/");
        

    })
    .catch((err) => {
        console.log(err);
    })

}



</script>




<style scoped>


</style>